package xju.springboot_maven11_12.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import xju.springboot_maven11_12.entity.User;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from  newtable where deleted = 0")
    List<User> selectByAll();

    User selectById(int id);

    User selectByName(@Param("sn") String sn, @Param("password") String password);
    @Select("select * from  newtable")
    List<User> pageList(IPage<User> page);

    @Select("select * from  newtable")
    IPage<User> pageList1(IPage<?> page);


//    @Insert("insert into  newtable(name,sn,password) values (#{name},#{sn},#{password})")
//    int insert(User user);
}
